package com.hmall.item.config;

import com.hmall.item.interceptor.MyItenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    @Autowired
    MyItenInterceptor myItenInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(myItenInterceptor)
               .addPathPatterns("/**")
               .excludePathPatterns("/employee/login","/backend/**","/front/**","/addr/**","/common/**","/user/sendMsg","/user/login");//放行静态资源和登陆资源
    }
}
